# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=py3-flask-httpauth
pkgver=4.8.0
pkgrel=2
pkgdesc="Basic and Digest HTTP authentication for Flask routes"
url="https://pypi.org/project/Flask-HTTPAuth"
arch="noarch"
license="MIT"
depends="py3-flask python3"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest py3-pytest-asyncio py3-asgiref"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/F/Flask-HTTPAuth/Flask-HTTPAuth-$pkgver.tar.gz"
builddir="$srcdir"/Flask-HTTPAuth-$pkgver

replaces="py-flask-httpauth" # Backwards compatibility
provides="py-flask-httpauth=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/Flask_HTTPAuth*.whl
}

sha512sums="
15878f45faf6bdde43d7b588539b044d621ba1ba590880e3d0a3bccf4e9bd04b898b3372775e99577b7e7955c4b6d2d7cc80df19ba30415c6b7c1d3183b7e5f4  Flask-HTTPAuth-4.8.0.tar.gz
"
